<%-- 
    Document   : edituser
    Created on : Jan 17, 2012, 10:59:15 PM
    Author     : omega
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<html:html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="css/view.css" type="text/css"/>   
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/function.js"></script>
        <title>edit user</title>
        <script>
            function goSelected() {
                redirect("${pageContext.request.contextPath}/addUser.do?dispatch=doListAddUser","_top");
            }
            function goEdit() {
                redirect("${pageContext.request.contextPath}/addUser.do?dispatch=doSaveEdit","_top");
            }
        </script>
    </head>
    <body>
        <html:form action="/addUser.do?dispatch=doedituser" >
            <div class="content1">                   
                <table class="three" cellspacing="0">
                    <tr>
                        <td colspan="2"><div align="center"><strong>ผู้ใช้งานระบบ</strong></div></td>
                    </tr>
                    <tr>
                        <th colspan="2">แก้ไขผู้ใช้งานระบบ</th>
                    </tr>
                    <tr>
                        <td>รหัสผู้ใช้: </td>
                        <td>
                            <label>
                                <html:text property="userEntity.useId" disabled="true" size="30"/>
                            </label>       
                        </td>
                    </tr>
                    <tr>
                        <td>ชื่อผู้ใช้ :</td>
                        <td>
                            <label>
                                <html:text property="userEntity.useName" size="30"/>
                            </label>                    
                        </td>
                    </tr>
                    <tr>

                    <tr>
                        <td>คำนำหน้า :</td>
                        <td>
                            <label>
                                <html:text property="userEntity.useTitle" size="30"/>
                            </label>                    
                        </td>
                    </tr>
                    <tr>
                        <td>ชื่อ :</td>
                        <td>
                            <label>
                                <html:text property="userEntity.useFirstName" size="30"/>
                            </label>                    
                        </td>
                    </tr>
                    <tr>
                        <td>นามสกุล :</td>
                        <td>
                            <label>
                                <html:text property="userEntity.useLastName" size="30"/>
                            </label>                    
                        </td>
                    </tr>
                    <tr>
                        <td>ตำแหน่ง :</td>
                        <td>
                            <label>
                                <html:text property="userEntity.usePosition" size="30"/>
                            </label>                    
                        </td>
                    </tr>
                    <tr>
                        <td>คณะ : </td>
                        <td>
                            <html:select property="userEntity.facId" onchange="goSelected();">
                                <html:option value="">กรุณาเลือก</html:option>
                                <html:optionsCollection property="facultyList" label="facName" value="facId"/>
                            </html:select>  
                        </td>
                    </tr>
                    <tr>
                        <td>ภาควิชา :</td>
                        <td>
                            <html:select property="userEntity.depId">
                                <html:optionsCollection property="departmentList" label="depName" value="depId"></html:optionsCollection>
                            </html:select>     
                        </td>
                    </tr>
                    <tr>
                        <td>ประเภท : </td>
                        <td>
                            <html:select property="userEntity.userTypeId"> 
                                <html:optionsCollection property="userTypeList" label="userTypeDesc" value="userTypeId"></html:optionsCollection>
                            </html:select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label>                                
                                <html:button property="btnSave" value="แก้ไข" onclick="goEdit();"/>                             
                            </label>                    
                        </td>
                        <td>
                            <label>                                
                                <html:cancel property="btnCancle" value="ยกเลิก"/>                             
                            </label>                    
                        </td>
                    </tr>
                </table> 
            </div>   
        </html:form>      
    </body>
</html:html>
